package cn.hrlly.tao2shou.biz;

import com.zhy.http.okhttp.OkHttpUtils;

import cn.hrlly.tao2shou.other.Config;
import cn.hrlly.tao2shou.callback.OrderDetailsCallback;
import cn.hrlly.tao2shou.domain.Orders;
import cn.hrlly.tao2shou.listener.OnOrderDetailsListener;

/**
 * User: gengliang
 * Date: 2016-01-31
 * Time: 18:37
 */

public class OrderDetailsBizImpl implements OrderDetailsBiz {

    private OnOrderDetailsListener onOrderDetailsListener;

    public OrderDetailsBizImpl(OnOrderDetailsListener onOrderDetailsListener) {
        this.onOrderDetailsListener = onOrderDetailsListener;
    }

    @Override
    public void getOrderDetails(Orders orders) {
        OkHttpUtils
                .post()
                .url(Config.key_url)
                .addParams(Config.key_action,Config.action_order_details)
                .addParams(Config.key_order_id,orders.getOrderId())
                .build()
                .execute(new OrderDetailsCallback(onOrderDetailsListener));
    }
}
